home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 12836 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: file open ??
  5. Date: Wed, 03 Apr 96 00:59:25 GMT
  6. Organization: none
  7. Message-ID: <828493165snz@genesis.demon.co.uk>
  8. References: <315FBE62.6E4A@advance.nl>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <315FBE62.6E4A@advance.nl> martin@advance.nl "Martin Bilstra" writes:
  15.  
  16. >Hello everyone,
  17. >
  18. >I'm having the following problem :
  19. >
  20. >In a program I'm using some extern variables. After calling an other function
  21. > those variables are 
  22. >getting there values, after this the function returns back to the main program
  23. > with the related 
  24. >value. In the main program the extern variables now have a value where I work
  25. > with, but then I 
  26. >get a problem. After returning from the function, I open a file but then the
  27. > values belonging to 
  28. >the extern variables are gone (there value is nothing).
  29.  
  30. You've done somethe badly wrong somewhere since opening a file cannot affect
  31. your global variables in a well-defined program.
  32.  
  33. >My own solution was the following :
  34. >I open the file before I call the function and I close the file after I stored
  35. > the variables. But 
  36. >I'm not convinced that's the real solution to the problem, because in other
  37. > programs I do the 
  38. >same and then things are going well. 
  39. >
  40. >Can someone help me ?
  41.  
  42. Not without more to go on. There is a bug in your code somewhere but inless
  43. you actually show us your code it is impossible to tell where.
  44.  
  45. -- 
  46. -----------------------------------------
  47. Lawrence Kirby | fred@genesis.demon.co.uk
  48. Wilts, England | 70734.126@compuserve.com
  49. -----------------------------------------
  50.